package top.yeyusmile.quartz;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import top.yeyusmile.service.BlackWordService;


/**
 * @author 夜雨
 * @Web www.yeyusmile.top
 * @date 2022/3/17 8:43
 */
@Component
@Slf4j
public class BanClearJob {

    @Autowired
    private BlackWordService blackWordService;


   //每次20分清空
    @Scheduled(cron = "0 */20 * * * ?")
    public void executeJob() {
        log.debug("正在清除禁言列表");
        blackWordService.clearBanSet();
        log.debug("禁言列表清理完毕");
    }

}

